import axios from 'axios';
// 获取用户列表
let user_list = (params) => axios.get('/user/user', { params });
// 获取分组列表
let user_group_list = (params) => axios.get('/user/user_group/list', { params });
// 添加/修改分组表单
let add_user_group = (params) => axios.get(`/user/user_group/add/${params}`);
//删除分组
let remove_user_group = (params) => axios.delete(`/user/user_group/del/${params}`);
// 添加/修改分组
let save_add_user_group = (data) => axios.post('/user/user_group/save', data);
// 保存用户分组
let save_user_group = (data) => axios.put('/user/save_set_group', data)
// 用户标签列表
let user_label_list = (params) => axios.get(`/user/label/${params}`);
// 获取标签分类（全部）
let user_label_cate = (params) => axios.get('/user/user_label_cate/all');
// 保存用户标签
let save_user_label = (data) => axios.put('/user/save_set_label', data)
// 等级列表
let vip_list = (params) => axios.get('/user/user_level/vip_list', { params });
// 添加用户表单
let create = (params) => axios.get('/user/user/create', { params });
// 编辑用户表单
let user_edit = (params) => axios.get('/user/user/:id/edit', { params });
// 用户详情
let user_msg = (params) => axios.get(`/user/user/${params}`);


//保存用户分组
let save_set_group = (data) => axios.put(`/user/save_set_group`, data);
// 添加友情链接
let push = (data) => axios.post('/app/wechat/push', data);
// 获取设置用户分组表单
let set_group = (data) => axios.post('/user/set_group', data);
//删除指定id的友情链接
let remove = (link_id, params) => axios.delete(`/link/${link_id}`, { params });
// 添加用户
let add_user = (data) => axios.post('/user/user', data);
// 用户详情
let user_info = (params) => axios.get(`/user/user/${params}`);
// 用户详情中（积分、消费、签到等信息）
let one_info = (id, params) => axios.get(`/user/one_info/${id}`, { params });

// 获取编辑其他表单
let edit_other = (params) => axios.get(`/user/edit_other/${params}`);

// 编辑其他
let update_other = (id, data) => axios.put(`/user/update_other/${id}`, data);

// 赠送付费会员时长表单
let give_level_time = (params) => axios.get(`/user/give_level_time/${params}`);

// 执行赠送付费会员
let save_give_level_time = (id, data) => axios.put(`/user/save_give_level_time/${id}`, data);



// 获取用户标签列表
let get_user_label = (params) => axios.get('/user/user_label', { params });
// 获取用户标签分类创建表单
let user_label_cate_create = (params) => axios.get('/user/user_label_cate/create', { params });
// 保存用户标签分类
let save_user_label_cate = (data) => axios.post('/user/user_label_cate', data);
// 用户标签添加/编辑表单
let set_user_label = (params) => axios.get(`/user/user_label/add/${params}`);
// 添加、编辑用户标签
let user_label_save = (data) => axios.post('/user/user_label/save', data);
//删除用户标签
let remove_user_label = (params) => axios.delete(`/user/user_label/del/${params}`);

// 获取用户标签分类编辑表单
let user_label_cate_edit = (params) => axios.get(`/user/user_label_cate/${params}/edit`);
// 编辑用户标签分类
let user_label_cate_save = (id, data) => axios.put(`/user/user_label_cate/${id}`, data);
//删除用户标签分类
let remove_user_label_cate = (params) => axios.delete(`/user/user_label_cate/${params}`);


// 创建等级表单
let user_level_create = (params) => axios.get('/user/user_level/create', { params });
// 设置等级的显示和隐藏
let set_show = (id, is_show) => axios.put(`/user/user_level/set_show/${id}/${is_show}`);
// 添加/修改等级
let save_level = (data) => axios.post("/user/user_level", data);
// 删除等级
let remove_level = (id) => axios.put(`/user/user_level/delete/${id}`);
// 获取后台图片
let getImage = (params) => axios.get("/file/file", { params });
// 获取图片分类
let getImageCate = (params) => axios.get("/file/category", { params });
// 删除图片
let remove_img = (data) => axios.post("file/file/delete", data);
// 移动图片
let do_move=(data)=>axios.put("file/file/do_move",data)
export default {
    user_list,
    user_group_list,
    save_user_group,
    add_user_group,
    save_add_user_group,
    remove_user_group,
    user_label_list,
    user_label_cate,
    save_user_label,
    vip_list,
    create,
    user_edit,
    user_msg,
    edit_other,
    give_level_time,
    save_give_level_time,
    push,
    set_group,
    save_set_group,
    add_user,
    user_info,
    one_info,
    update_other,

    get_user_label,
    user_label_cate_create,
    save_user_label_cate,
    set_user_label,
    user_label_save,
    remove_user_label,
    user_label_cate_edit,
    user_label_cate_save,
    remove_user_label_cate,

    user_level_create,
    set_show,
    save_level,
    remove_level,
    getImage,
    getImageCate,
    remove_img,
    do_move
}